const http=require('http');

let client = http.request({
	host:'www.baidu.com',//也可以是localhost
	port:80,
	pathname:'/s?ie=utf-8&f=3&rsv_bp=1&rsv_idx=1&tn=baidu&wd=滚动图片代码&oq=%25E6%25BB%259A%25E5%258A%25A8%25E5%25B9%25BF%25E5%2591%258A%25E7%25AE%25B1&rsv_pq=f76b91760003d6c2&rsv_t=13c2mknVKEM2W%2FcrHVduOyorzRIhF3zCc5XGoeb3dwU%2FDm7I3YbMzIPOwoc&rqlang=cn&rsv_enter=1&inputT=7170&rsv_sug3=21&rsv_sug1=19&rsv_sug7=100&rsv_sug2=1&prefixsug=%25E6%25BB%259A%25E5%258A%25A8%25E5%259B%25BE%25E7%2589%2587&rsp=0&rsv_sug4=8169',
},res=>{

	let str='';
	res.on('data',data=>{
		str+=data; 
	});
	res.on('end',()=>{
		console.log(str);
	});
	res.on('error',err=>{
		console.log('请求出错');
	});

});

client.end();
//E:\localhost\koa>node 1.js > bd.html